package com.fhz.mvvmshopjava.ui.goods;

import androidx.lifecycle.LiveData;

import com.fhz.mvvmshopjava.api.ServiceApi;
import com.fhz.mvvmshopjava.core.BaseRepository;
import com.fhz.mvvmshopjava.entity.Order;
import com.fhz.mvvmshopjava.utils.RetrofitManger;
import com.fhz.utilsfhz.ApiResponse;

import java.util.List;

import javax.inject.Inject;

/**
 * 时间:2022/6/9
 *
 * @author msfeng
 * 简述: TODO
 */
public class GoodsRepository extends BaseRepository<GoodsDataSource> {

    @Inject
    public GoodsRepository(GoodsDataSource model) {
        super(model);
    }

    LiveData<ApiResponse<Order>> addOrder(Order order){
        return model.addOrder(order);
    }

    LiveData<ApiResponse<List<Order>>> getAllOrderByUser(Integer userId, Integer state){
        return model.getAllOrderByUser(userId,state);
    }


    LiveData<ApiResponse<String>> updateOrderNum(Integer userId, Integer num){
        return model.updateOrderNum(userId,num);
    }
}

